import request from '@/utils/request'

/**
 *请求组织架构的接口
 * @returns
 */
export const getDepartment = () => {
  return request.get('/company/department')
}

/**
 * 根据id删除部门
 * **/
export function delDepartmentsApi(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

/**
 * 获取部门负责人列表
 * **/
export const getUserSimpleListApi = () => {
  return request.get('/sys/user/simple')
}

/**
 *  新增部门
 * **/
export const addUserSimpleListApi = (form) => {
  return request.post('/company/department', form)
}

/**
 *获取修改时的数据详情
 * @param {*} id
 * @returns
 */
export const getDepartmentname = (id) => {
  return request.get(`/company/department/${id}`)
}

/**
 *修改组织部门的接口
 * @param {*} id
 * @returns
 */
export const putDepartmentname = (form) => {
  return request.put(`/company/department/${form.id}`, form)
}
